//
//  AboutInfo.m
//  NRWMall
//
//  Created by 邢毅 on 2018/5/9.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "AboutInfo.h"
#import <sys/utsname.h>

NSString *getAppVersion(void) {
    
    return [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"];
}

NSString *getSystemVersion(void) {
    
    return [UIDevice currentDevice].systemVersion;
}

BOOL isMoreThanIPhone7(void) {
    
    struct utsname systemInfo;
    
    uname(&systemInfo);
    
    NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding];
    
    if ([platform isEqualToString:@"iPhone1,1"] ||
        [platform isEqualToString:@"iPhone1,2"] ||
        [platform isEqualToString:@"iPhone2,1"] ||
        [platform isEqualToString:@"iPhone3,1"] ||
        [platform isEqualToString:@"iPhone3,2"] ||
        [platform isEqualToString:@"iPhone3,3"] ||
        [platform isEqualToString:@"iPhone4,1"] ||
        [platform isEqualToString:@"iPhone5,1"] ||
        [platform isEqualToString:@"iPhone5,2"] ||
        [platform isEqualToString:@"iPhone5,3"] ||
        [platform isEqualToString:@"iPhone5,4"] ||
        [platform isEqualToString:@"iPhone6,1"] ||
        [platform isEqualToString:@"iPhone6,2"] ||
        [platform isEqualToString:@"iPhone7,1"] ||
        [platform isEqualToString:@"iPhone7,2"] ||
        [platform isEqualToString:@"iPhone8,1"] ||
        [platform isEqualToString:@"iPhone8,2"] ||
        [platform isEqualToString:@"iPhone8,4"]) {
        return NO;
    } else {
        return YES;
    }
}
